<template>
    <div class="safe3View3">
        <!-- 头部 -->
        <!-- <div class="header">
            <x-icon type="ios-arrow-left" size="" class="icon-white" @click="$router.push('./safeCheck')"></x-icon>需要执行的检查
        </div> -->
        <!-- 内容部分 -->
        <div class="safe3_main3">
            <div class="safe3Box3">
                <h1>安全检查次数: {{total}} 次</h1>
                <ul>
                    <li class="clearfix" @click="router(item)" v-for="(item,index) in listArr" :key="index">
                        <div class="leftDiv">
                            <h3>{{item.safeCheckTitleItem}} </h3>
                            <p>({{item.Category |type}} ){{item.safeCheckType}} </p>
                        </div>
                        <div class="rightDiv">
                            {{item.safeCheckTimeItem |time}}
                            <x-icon type="ios-arrow-right" size="20" class="icon-white" ></x-icon>
                        </div>
                    </li>
                </ul>
            </div>
        </div>
        <myMenu @clickBack="back" backPath='/safeCheck'></myMenu>
    </div>
</template>
<script>
import myMenu from '@/commonComponents/menu'
export default {
  components: {
    myMenu
  },
  data () {
      return {
        param: {
            allowPaging: true,
            business: 'GetToDoCheckWork',
            pageIndex: 0,
            pageSize: 20,
            tokenId: 'D0853C0CE5A6A478F5C613B840394FC3',
            userId: ''
        },
        listArr: [],
        total: 0
      }
  },
  mounted () {
      var token = JSON.parse(window.localStorage.getItem('userInfo'))
      this.param.userId = token.userid
      this.dataArr()
  },
  filters: {
      time (val) {
          if (val.length > 10) {
              return val.substr(0, 10)
          }
      },
      type (val) {
          if (val && val == 'company') {
              return '公司层级'
          }
          if (val && val == 'department') {
              return '分公司'
          }
          if (val && val == 'project') {
              return '项目层级'
          }
      }
  },
  methods: {
       back () {

      },
    router (item) {
        this.$router.push({path: './view3Details', query: {id: item.safeCheckIdItem}})
        window.sessionStorage.setItem('passId', item.safeCheckIdItem)
    },
    dataArr () {
      this.$axiosAjax.getConfigJson(this.param).then((res) => {
            if (res.status) {
                this.listArr = res.data.data.safeCheckList
                this.total = res.data.count
            }
         }
      )
    }
  }
}
</script>
<style lang="less">
.safe3View3{
    width: 100%;
    height: 100%;
    .header{
        width: 100%;
        height: 40px;
        line-height: 40px;
        text-align: center;
        position: relative;
        font-size: 18px;
        background: #2269ff;
        color: #fff;
        .vux-x-icon{
            fill:cornsilk;
            position: absolute;
            left: 0;
            top: 5px;
            width: 30px;
            height: 30px;
        }
    }
    .safe3_main3{
        height: 603px;
        width: 100%;
        background-color: #ebeef2;
        .safe3Box3{
            width: 100%;
            height: 603px;
            padding: 0 10px;
            background-color: #fff;
            h1{
                height: 60px;
                line-height: 60px;
                font-size: 16px;
                color: #2269ff;
                border-bottom:1px solid #eee;
            }
            ul{
                padding-left: 0!important;
                li{
                    padding: 10px 0;
                    border-bottom:1px solid #eee;
                    width: 100%;
                    .leftDiv{
                        float: left;
                        width: 240px;
                        h3{
                            font-size: 14px;
                            height: 30px;
                            width: 100%;
                            line-height: 30px;
                            color: #333;
                            -webkit-line-clamp:2;
                            display: -webkit-box;
                            -webkit-box-orient: vertical;
                            overflow: hidden;
                        }
                        p{
                            font-size: 14px;
                            line-height: 20px;
                            color: #999;
                        }
                    }
                    .rightDiv{
                        float: right;
                        width: 106px;
                        height: 40px;
                        line-height: 40px;
                        font-size: 14px;
                        color: #999;
                        .vux-x-icon{
                            fill: #999;;
                            float: right;
                            margin-top: 10px;
                            margin-right: -4px;
                        }
                    }
                }
            }
        }
    }
}
</style>
